import Vue from 'vue'
import Router from 'vue-router'

//1.导入对应的路由组件
import cartContainer from '../components/tabBar/cartContainer.vue'
import searchContainer from '../components/tabBar/searchContainer.vue'
import homeContainer from '../components/tabBar/homeContainer.vue'
import memberContainer from '../components/tabBar/memberContainer.vue'
import newsList from'../components/news/newsList.vue'
import newsContent from '../components/news/newsContent.vue'
import photoList from '../components/photoShare/photoList.vue'
import photoInfo from'../components/photoShare/photoInfo.vue'
import goodsList from '../components/goods/goodsList.vue'
import goodsInfo from '../components/goods/goodsInfo.vue'
import goodsComment from '../components/goods/goodsComment.vue'
import goodsDesc from '../components/goods/goodsDesc.vue'
Vue.use(Router)
// 把路由对象暴露出去
// 2.路由规则匹配
export default new Router({
  routes: [
  	{
  		path:'/',redirect:'/home'
  	},
    {
    	path:'/home',component:homeContainer
    },
    { path:'/member',component:memberContainer},
    {path:'/cart',component: cartContainer},
    {path:'/search',component:searchContainer},
    {path:'/home/news',component:newsList},
     {path:'/home/news/newsContent/:id',component:newsContent},
     {path:'/home/photoList',component:photoList},
     {
      path:'/home/photoList/photoInfo/:imgid',component:photoInfo
     },
     {
      path:'/home/goodsList',component:goodsList
     },
     {
      path:'/home/goodsList/goodsInfo/:id',component:goodsInfo
     },
     {
      path:'/home/goodsList/goodsInfo/goodsDesc/:id',component:goodsDesc,name:'goodsDesc'
     },
     {
      path:'/home/goodsList/goodsInfo/goodsComment/:id',component:goodsComment,name:'goodsComment'
     },
     

  ],
  linkActiveClass:'mui-active'
})
